#include "inc.h"
#include<unistd.h>

#define BUFF_SIZE 64 

int l_set_cwd(lua_State* L){
    const char* path = lua_tostring(L, -1);
    lua_pushboolean(L, chdir(path) == 0);
    return 1;
}

int l_get_cwd(lua_State* L){
    char buff[BUFF_SIZE] = {0};
    lua_pushstring(L, getcwd(buff, BUFF_SIZE));
    return 1;
}